class AICharacter {
  final String id;
  final String name;
  final String description;
  final String avatarUrl;
  final int unlockPrice;
  final bool isUnlocked;
  final String personality;
  final List<String> topics;

  AICharacter({
    required this.id,
    required this.name,
    required this.description,
    required this.avatarUrl,
    required this.unlockPrice,
    this.isUnlocked = false,
    required this.personality,
    required this.topics,
  });

  factory AICharacter.fromJson(Map<String, dynamic> json) {
    return AICharacter(
      id: json['id'] as String,
      name: json['name'] as String,
      description: json['description'] as String,
      avatarUrl: json['avatarUrl'] as String,
      unlockPrice: json['unlockPrice'] as int,
      isUnlocked: json['isUnlocked'] as bool? ?? false,
      personality: json['personality'] as String,
      topics: List<String>.from(json['topics'] as List),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'name': name,
      'description': description,
      'avatarUrl': avatarUrl,
      'unlockPrice': unlockPrice,
      'isUnlocked': isUnlocked,
      'personality': personality,
      'topics': topics,
    };
  }

  AICharacter copyWith({
    String? id,
    String? name,
    String? description,
    String? avatarUrl,
    int? unlockPrice,
    bool? isUnlocked,
    String? personality,
    List<String>? topics,
  }) {
    return AICharacter(
      id: id ?? this.id,
      name: name ?? this.name,
      description: description ?? this.description,
      avatarUrl: avatarUrl ?? this.avatarUrl,
      unlockPrice: unlockPrice ?? this.unlockPrice,
      isUnlocked: isUnlocked ?? this.isUnlocked,
      personality: personality ?? this.personality,
      topics: topics ?? this.topics,
    );
  }
} 